package com.bing.jh.enums;

import lombok.Getter;

public enum DzWzUserGroupStatEnums {

    Households2W(1, "2万户以上"),
    Households1Wto2W(2, "1~2万户"),
    Households6Kto1W(3, "6千~1万户"),
    Households4Kto6K(4, "4~6千户"),
    Households2Kto4K(5, "2~4千户"),
    Households1Kto2K(6, "1~2千户"),
    Households1K(7, "1~1千户"),
    HouseholdsZero(8, "0户"),


    ;


    @Getter
    private Integer code;

    @Getter
    private String type;

    DzWzUserGroupStatEnums(Integer code, String type) {
        this.code = code;
        this.type = type;
    }

    public static DzWzUserGroupStatEnums fromCode(Integer code) {
        for (DzWzUserGroupStatEnums groupStat : values()) {
            if (groupStat.code.equals(code)) {
                return groupStat;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return String.format("%s (%d)", type, code);
    }

}
